from django.contrib import admin

# Register your models here.
from .models import *
from django.utils.html import format_html


admin.site.site_header = '相机商城'  # 页面头部的标题
admin.site.site_title = '相机商城后台管理'  # 浏览器标签页的标题

class UserAdmin(admin.ModelAdmin):
    list_display = ('id','image','name', 'sex', 'ega', 'password','email','phone')
    ordering = ('id',)

# class AddressAdmin(admin.ModelAdmin):
#     list_display = ('id','aname','aphone', 'addr', 'isdefault', 'userinfo')
#     ordering = ('id',)

    def image(self, obj):
        return format_html('<img src="/{}" style="width:100px;height:auto;">',obj.img)


admin.site.register(User, UserAdmin)
# admin.site.register(Address, AddressAdmin)